Solved: sgplot output error when running SAS 9.4 from a batch file 您所在的位置:网站首页 EPS output from sgplot Solved: sgplot output error when running SAS 9.4 from a batch file

Solved: sgplot output error when running SAS 9.4 from a batch file

2024-07-13 09:48| 来源: 网络整理| 查看: 265

Hi, 

I am running SAS daily from a batch file to produce a pdf containing a couple of tables, a couple of plots from gplot and then several from sgplot. My program worked in 9.3, but when I updated to 9.4 the tables and the gplot output is produced, but the sgplot output is not and I get "ERROR: Trying to open a key that does not exist: CORE\PRINTING\PRINTERS\\DEFAULT SETTINGS".

This only happens when I run sas from a batch file, not if I open SAS and run from there.

I can't find any reference to sgplots run from batch files other than that ods graphics are off by default in batch mode, but turning ods graphics on in the program doesn't fix my problem.

I would really appreciate any help!

Thanks,

Anne

 

Here is the code I am running:

 

 

options nodate nonumber; goptions device=pdf border gsfmode=replace hsize=8 vsize=8; title "LTBE Soil Water Probes"; title2 "&pdate"; ods pdf file="c:\projects\bioenergy\LTBE\data\weather\soil probes &pdate..pdf" pdftoc=1; ods noproctitle; ****tables and gplot code not included************; ods graphics on; ods pdf startpage=now; title "Long-Term Biomass Experiment"; title2 "&pyear"; ods layout gridded width=7in height=8in columns=2 rows=2 order_type=row_major; ods region x=0 y=5% width=50% height=50%; ods proclabel "Whole Season by Treatment Plots"; ods noproctitle; proc sgplot data=forplts2 description="Control"; series x=datetime y=CA / legendlabel="Austin" lineattrs=(thickness=1 color=stgy) break; series x=datetime y=CH /legendlabel="Houston" lineattrs=(thickness=1 color=deo) break; needle x=datetime y=rain_mm /legendlabel="rain" y2axis lineattrs=(thickness=1 color=cyan); xaxis label=" "; yaxis label="volumetric soil water content (%)" labelattrs=(size=1.1%) values=(0 to 60 by 10); y2axis label="mm of water" labelattrs=(size=1.1%) values=(0 to 100 by 10); title "Treatment = Control"; run; ods region x=50% y=5% width=50% height=50%; ods proclabel " "; proc sgplot data=forplts2 description="Spring drought"; series x=datetime y=PPTSDA /legendlabel="Austin" lineattrs=(thickness=1 color=stgy) break; series x=datetime y=PPTSDH /legendlabel="Houston" lineattrs=(thickness=1 color=deo) break; needle x=datetime y=rain_mm /legendlabel="rain" y2axis lineattrs=(thickness=1 color=cyan); xaxis label=" "; yaxis label="volumetric soil water content (%)" labelattrs=(size=1.1%) values=(0 to 60 by 10); y2axis label="mm of water" labelattrs=(size=1.1%) values=(0 to 100 by 10); title "Treatment = Spring Drought"; run; ods region x=0 y=42% width=50% height=50%; ods proclabel " "; proc sgplot data=forplts2 description="Winter drought"; series x=datetime y=PPTWDA /legendlabel="Austin" lineattrs=(thickness=1 color=stgy) break; series x=datetime y=PPTWDH /legendlabel="Houston" lineattrs=(thickness=1 color=deo) break; needle x=datetime y=rain_mm /legendlabel="rain" y2axis lineattrs=(thickness=1 color=cyan); xaxis label=" "; yaxis label="volumetric soil water content (%)" labelattrs=(size=1.1%) values=(0 to 60 by 10); y2axis label="mm of water" labelattrs=(size=1.1%) values=(0 to 100 by 10); title "Treatment = Winter Drought"; run; ods region x=50% Y=42% width=50% height=50%; ods proclabel " "; proc sgplot data=forplts2 description="ET replacement"; series x=datetime y=ETA /legendlabel="Austin" lineattrs=(thickness=1 color=stgy) break; series x=datetime y=ETH /legendlabel="Houston" lineattrs=(thickness=1 color=deo) break; needle x=datetime y=rain_mm /legendlabel="rain" y2axis lineattrs=(thickness=1 color=cyan); needle x=datetime y=irrig_mm /legendlabel="irrigation" y2axis lineattrs=(thickness=1 color=blue); xaxis label=" "; yaxis label="volumetric soil water content (%)" labelattrs=(size=1.1%) values=(0 to 60 by 10); y2axis label="mm of water" labelattrs=(size=1.1%) values=(0 to 100 by 10); title "Treatment = ET Replacement"; keylegend /across=4; run; *season by soil plots; ods pdf startpage=now; title "Long Term Biomass Experiment"; title2 "&pyear"; ods layout gridded width=7in height=8in columns=2 rows=2 order_type=row_major; ods proclabel "Whole Season by Soil Plots"; ods region x=0 y=5% width=50% height=50%; proc sgplot data=forplts2 description="Austin ET and control"; series x=datetime y=CA / legendlabel="Control" lineattrs=(thickness=1 color=green) break; series x=datetime y=ETA /legendlabel="ET replacement" lineattrs=(thickness=1 color=purple) break; needle x=datetime y=rain_mm /legendlabel="rain" y2axis lineattrs=(thickness=1 color=cyan); needle x=datetime y=irrig_mm /legendlabel="irrigation" y2axis lineattrs=(thickness=1 color=blue); xaxis label=" "; yaxis label="volumetric soil water content (%)" labelattrs=(size=1%) values=(0 to 60 by 10); y2axis label="mm of water" labelattrs=(size=1%) values=(0 to 100 by 10); title "Soil = Austin"; keylegend /across=4; run; ods region x=50% y=5% width=50% height=50%; ods proclabel " "; proc sgplot data=forplts2 description="Houston ET and control"; series x=datetime y=CH / legendlabel="Control" lineattrs=(thickness=1 color=green) break; series x=datetime y=ETH /legendlabel="ET replacement" lineattrs=(thickness=1 color=purple) break; needle x=datetime y=rain_mm /legendlabel="rain" y2axis lineattrs=(thickness=1 color=cyan); needle x=datetime y=irrig_mm /legendlabel="irrigation" y2axis lineattrs=(thickness=1 color=blue); xaxis label=" "; yaxis label="volumetric soil water content (%)" labelattrs=(size=1%) values=(0 to 60 by 10); y2axis label="mm of water" labelattrs=(size=1%) values=(0 to 100 by 10); title "Soil = Houston"; keylegend /across=4; run; ods region x=0 y=45% width=50% height=50%; ods proclabel " "; proc sgplot data=forplts2 description="Austin Droughts and control"; series x=datetime y=CA / legendlabel="Control" lineattrs=(thickness=1 color=green) break; series x=datetime y=PPTWDA /legendlabel="Winter drt" lineattrs=(thickness=1 color=viy) break; series x=datetime y=PPTSDA /legendlabel="Spring drt" lineattrs=(thickness=1 color=vio) break; needle x=datetime y=rain_mm /legendlabel="rain" y2axis lineattrs=(thickness=1 color=cyan); xaxis label=" "; yaxis label="volumetric soil water content (%)" labelattrs=(size=1%) values=(0 to 60 by 10); y2axis label="mm of water" labelattrs=(size=1%) values=(0 to 100 by 10); title "Soil = Austin"; keylegend /across=4; run; ods region x=50% Y=45% width=50% height=50%; ods proclabel " "; proc sgplot data=forplts2 description="Houston Droughts and control"; series x=datetime y=CH / legendlabel="Control" lineattrs=(thickness=1 color=green) break; series x=datetime y=PPTWDH /legendlabel="Winter drt" lineattrs=(thickness=1 color=viy) break; series x=datetime y=PPTSDH /legendlabel="Spring drt" lineattrs=(thickness=1 color=vio) break; needle x=datetime y=rain_mm /legendlabel="rain" y2axis lineattrs=(thickness=1 color=cyan); xaxis label=" "; yaxis label="volumetric soil water content (%)" labelattrs=(size=1%) values=(0 to 60 by 10); y2axis label="mm of water" labelattrs=(size=1%) values=(0 to 100 by 10); title "Soil = Houston"; keylegend /across=4; run; ods layout end; title; axis; ods pdf close;

 

Here is the contents of the batch file:

"c:\program files\SASHome\SASFoundation\9.4\sas.exe" -log "c:\projects\bioenergy\LTBE\data\Daily soil moisture sensors.log" -sysin "c:\projects\bioenergy\LTBE\data\sasdatasets\Daily soil moisture sensors.sas" -config "c:\program files\SASHome\SASFoundation\9.4\sasv9.cfg"



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有